package hungry;

import com.sun.org.apache.xalan.internal.xsltc.dom.SingletonIterator;
import sun.security.jca.GetInstance;

public class HungrySingleton {
    private static  HungrySingleton instance = new HungrySingleton();

    //构造方法私有化
    private  HungrySingleton(){
        if(HungrySingleton.instance!=null)
            throw new RuntimeException("不允许创建多个实例");
    }

    public static HungrySingleton getInstance(){
        return instance;
    }
}
